var defDoubleLineChartOption = {
	backgroundColor: 'white',
    tooltip: {
        trigger: 'axis',
        formatter:function(params){
        	var result = '';
        	var name = '';
        	for(var i=0;i<params.length;i++){
        		var param = params[i];
        		if(i == 0){
        			name = param.name;
        			result +=name;
        		}
        		result += '<br/>'+param.seriesName+ ':'+param.data;
        	}
        	return result;
        }
    },
    legend: {
        data:['水位','警戒水位']
    },
    toolbox: {
        show: true
    },
    calculable: true,
    xAxis: [{
        name: '日期',
        type: 'category',
        boundaryGap: false
    }],
    yAxis: [{
        name: '水位(m)',
        type: 'value'
    },{
        name: '警戒水位(m)',
        type: 'value'
    }],
    series: [{
        name: '水位',
        type: 'line',
        itemStyle: {
            normal: {
                color: '#498AF3',
                borderWidth: '1px'
            }
        },
        smooth: true,
        symbol: 'none'
    },{
        name: '警戒水位',
        type: 'line',
        yAxisIndex:1,
        itemStyle: {
            normal: {
                color: 'rgb(253,151,31)',
                borderWidth: '1px'
            }
        },
        smooth: true,
        symbol: 'none'
    }]
};

function doubleLineExtend(data) {
    var chartOption = $.extend(true, {}, defDoubleLineChartOption, {
        xAxis: [{
            data: data.time
        }],
        yAxis:[{
        	min:data.min,
        	max:data.max
        },{
        	min:data.min,
        	max:data.max
        }],
        series: [{
            data: data.value
        },{
        	data:data.value2
        }]
    });
    return chartOption;
}
